package com.example.automanagement.service.serviceImpl;

import com.example.automanagement.entity.AutoArchives;
import com.example.automanagement.entity.DriverArchives;
import com.example.automanagement.mapper.ArchiveMapper;
import com.example.automanagement.service.ArchiveService;
import com.example.automanagement.util.PageBean;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArchiveServiceImpl implements ArchiveService {
    @Resource
    private ArchiveMapper archiveMapper;

    @Override
    public List<AutoArchives> list() {
        return archiveMapper.list();
    }

    @Override
    public void add(AutoArchives archives) {
        archiveMapper.add(archives);
    }

    @Override
    public void delete(AutoArchives archives) {
        archiveMapper.delete(archives);
    }

    @Override
    public void update(AutoArchives archives) {
        archiveMapper.update(archives);
    }

    @Override
    public PageBean pageList(Integer page, Integer pageSize, String autoPlateNum, Integer seatNum, String autoType) {
        return null;
    }
    @Override
    public AutoArchives getAutoIdByPlate(String autoPlate) {
        return archiveMapper.getAutoIdByPlate(autoPlate);
    }

  /* @Override
   public PageBean pageList(Integer page, Integer pageSize,String autoPlateNum,Integer seatNum, String autoType) {
       //1.分页参数
       PageHelper.startPage(page, pageSize);
       //2.查询参数
       List<AutoArchives> archives = archiveMapper.list();
       Page<AutoArchives> p = (Page<AutoArchives>) archives;


       PageBean pageBean = new PageBean(p.getTotal(),p.getResult());
       return pageBean;
   }*/



    @Override
    public AutoArchives getArchiveById(String autoId) {
        return archiveMapper.getArchiveById(autoId);
    }

    @Override
    public List<AutoArchives> fetchPlates() {
        return archiveMapper.fetchPlates();
    }



}
